<?php /* Smarty version 2.6.20, created on 2016-04-11 19:57:23
         compiled from product_list.htm */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'in_array', 'product_list.htm', 44, false),)), $this); ?>
<link href="admin.css" rel="stylesheet" type="text/css" />
<script src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/script/jquery-1.4.4.min.js" type="text/javascript" charset="utf-8" ></script>
<script type="text/javascript">
	$(function(){
		/* 全选 */
		 $('.checkall').click(function(){
			var _self = this;
			$('.checkitem').each(function(){
				if (!this.disabled)
				{
					$(this).attr('checked', _self.checked);
				}
			});
			$('.checkall').attr('checked', this.checked);
		});	 
	});
</script>
<div class="container dialog" style="width:94%; margin:auto;">
<form action="" method="get">
<input type="hidden" name="m" value="<?php echo $_GET['m']; ?>
">
<input type="hidden" name="s" value="<?php echo $_GET['s']; ?>
">
<input type="hidden" name="id" value="<?php echo $_GET['id']; ?>
">
<input type="hidden" name="type" value="<?php echo $_GET['type']; ?>
">
<table class="table select_table" style="margin-bottom:0;">
    <tbody>
    	<tr>
            <td width="70">产品名称:</td>
            <td width="210"><input type="text" name="key" class="w200" value="<?php echo $_GET['key']; ?>
" /></td>
			<td width="70">产品分类:</td>
            <td>
            <select name="catid">
            	<option value="">选择分类</option>
                <?php $_from = $this->_tpl_vars['re']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                	<option  <?php if ($_GET['catid'] == $this->_tpl_vars['list']['catid']): ?>selected="selected"<?php endif; ?> value="<?php echo $this->_tpl_vars['list']['catid']; ?>
"><?php echo $this->_tpl_vars['list']['cat']; ?>
</option>
                <?php endforeach; endif; unset($_from); ?>
            </select>
            </td>
            <td width="70">产品标签:</td>
            <td>
            <select name="tags">
            	<option value="">选择标签</option>
                <?php $_from = $this->_tpl_vars['de']['all_tags']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                        
             			<option <?php if (@ ((is_array($_tmp=$this->_tpl_vars['list']['id'])) ? $this->_run_mod_handler('in_array', true, $_tmp, $this->_tpl_vars['de']['tags']) : in_array($_tmp, $this->_tpl_vars['de']['tags']))): ?> selected="selected" <?php endif; ?> value="<?php echo $this->_tpl_vars['list']['id']; ?>
"><?php echo $this->_tpl_vars['list']['tags']; ?>
</option>
                           
                            <?php $_from = $this->_tpl_vars['list']['stags']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['slist']):
?>
                            <option  <?php if (@ ((is_array($_tmp=$this->_tpl_vars['slist']['id'])) ? $this->_run_mod_handler('in_array', true, $_tmp, $this->_tpl_vars['de']['tags']) : in_array($_tmp, $this->_tpl_vars['de']['tags']))): ?> selected="selected" <?php endif; ?> value="<?php echo $this->_tpl_vars['slist']['id']; ?>
">|__<?php echo $this->_tpl_vars['slist']['tags']; ?>
</option>
                            	    
                                    <?php $_from = $this->_tpl_vars['slist']['stags']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['sslist']):
?>
                                    <option <?php if (@ ((is_array($_tmp=$this->_tpl_vars['sslist']['id'])) ? $this->_run_mod_handler('in_array', true, $_tmp, $this->_tpl_vars['de']['tags']) : in_array($_tmp, $this->_tpl_vars['de']['tags']))): ?> selected="selected" <?php endif; ?> value="<?php echo $this->_tpl_vars['sslist']['id']; ?>
">|____<?php echo $this->_tpl_vars['sslist']['tags']; ?>
</option>
                                    
                                    <?php $_from = $this->_tpl_vars['sslist']['stags']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['lists']):
?>
                                    <option <?php if (@ ((is_array($_tmp=$this->_tpl_vars['lists']['id'])) ? $this->_run_mod_handler('in_array', true, $_tmp, $this->_tpl_vars['de']['tags']) : in_array($_tmp, $this->_tpl_vars['de']['tags']))): ?> selected="selected" <?php endif; ?> value="<?php echo $this->_tpl_vars['lists']['id']; ?>
">|______<?php echo $this->_tpl_vars['lists']['tags']; ?>
</option>
                            		<?php endforeach; endif; unset($_from); ?>
                            		<?php endforeach; endif; unset($_from); ?> 
                                    
                            <?php endforeach; endif; unset($_from); ?> 
                            
                        <?php endforeach; endif; unset($_from); ?> 
            </select>
            </td>
        </tr>
        <tr>    
            <td width="70">产品编号:</td>
            <td width="210"><input type="text" name="code" class="w200" value="<?php echo $_GET['code']; ?>
" /></td>
            <td width="50">产品ID:</td>
            <td width="100"><textarea name="product_id" style="resize:horizontal;height:30px;"><?php echo $_GET['product_id']; ?>
</textarea></td>
            <td width="70">品牌:</td>
            <td>
            	<input style="width:100px;" type='text' name='brand' id='brand' value="<?php echo $_GET['brand']; ?>
" placeholder='输入搜索词' autocomplete="off"/>
            	<ul id="brandlist" style="display:none;position:absolute;background-color:#fff;border: 1px solid rgb(207, 201, 201);width: 98px;">
       			</ul>
            </td>
            <td colspan="2"><input type="image" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/image/admin/search.gif" /></td>
        </tr>
    </tbody>
</table>
</form>
<form action="" method="post">
<table class="table alc" id="<?php echo $_GET['type']; ?>
_table">
    <tbody>
        <tr class="header">
            <th width="20"></th>
            <th class="150">产品ID</th>
            <th class="al">产品名称</th>
            <th width="100" class="al">产品编号</th>
            <th width="100">产品分类</th>
            <th width="100">产品标签</th>
            <th width="100">所属品牌</th>
            <th width="70">销售价</th>
            <th width="70">市场价</th>
            <!-- <th width="70">税率</th> -->
        </tr>
        <?php $_from = $this->_tpl_vars['de']['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['num'] => $this->_tpl_vars['list']):
?>
        <tr>
            <td>
            <?php if ($this->_tpl_vars['spikeid'] == 'spikeid' || $_GET['spikeid'] == 'spikeid'): ?>
            				<input type="radio" value="<?php echo $this->_tpl_vars['list']['id']; ?>
,<?php echo $this->_tpl_vars['list']['pid']; ?>
,<?php echo $this->_tpl_vars['list']['pname']; ?>
" class="checkitem" name="chk">
            	<?php else: ?><input type="checkbox" value="<?php echo $this->_tpl_vars['list']['id']; ?>
" class="checkitem" name="chk[]"><?php endif; ?>
            </td>
            <td width="150"><?php echo $this->_tpl_vars['list']['id']; ?>
</td>
            <td class="al td250">
            <div class="name" title="<?php echo $this->_tpl_vars['list']['pname']; ?>
"><?php echo $this->_tpl_vars['list']['pname']; ?>
</div>
            </td>
            <td class="al"><?php echo $this->_tpl_vars['list']['code']; ?>
</td>
            <td><?php echo $this->_tpl_vars['list']['catname']; ?>
</td>
            <td><?php echo $this->_tpl_vars['list']['tagnames']; ?>
</td>
            <td><?php echo $this->_tpl_vars['list']['brand']; ?>
</td>
            <td><?php echo $this->_tpl_vars['list']['price']; ?>
</td>
            <td><?php echo $this->_tpl_vars['list']['market_price']; ?>
</td>
            <!-- <td><?php echo $this->_tpl_vars['list']['tax_rate']; ?>
</td> -->
        </tr>
        <?php endforeach; else: ?>
        <tr>
            <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
        </tr>
        <?php endif; unset($_from); ?>
    </tbody>
    <tfoot>        
          <tr>
            <td colspan="2" class="al">
                <div class="del">
                <input type="checkbox" class="checkall" id="del">
                <label for="del">&nbsp;&nbsp;全选</label>
                </div>
				<input type="hidden" name="id" value="<?php echo $_GET['id']; ?>
" />
				<input type="hidden" name="type" value="<?php echo $_GET['type']; ?>
">
                <input type="hidden" name="act" value="add" />
                <input type="button" id="save" value="保存" />
            </td>
            <td colspan="99"><div class="page"><?php echo $this->_tpl_vars['de']['page']; ?>
</div></td>
        </tr>
    </tfoot>
</table>
</form>
<script>
//直接搜品牌
$('#brand').bind('input',function(e){
	var value=$(this).val();
	if(value==''){
		$('#brandlist').hide();
		return ;
	}
	else{
		$.get('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=product&s=product.php&operation=getbrand&brandname='+value,function(data){
			$('#brandlist').show();
			$('#brandlist').html(""+data);
		});
	}
});
$('body').bind('click',function(e){
	$('#brandlist').hide();
});
$('#brandlist').delegate('li','click',function(){
	var _this=$(this);
	var brandName=_this.text();
		var brandId=_this.attr('bid');
		$('#brand').val(brandName);
		$('#brandid').val(brandId);
		$('#brandlist').hide();
});

$('#save').click(function(){
	var obj=$("input[class='checkitem']:checked");
	if(!obj.length)
	{
		alert("请选择数据，再进行操作!");
		return false;
	}
	window.parent.main.addrow("<?php echo $_GET['type']; ?>
",0);
	window.parent.DialogManager.close("<?php echo $_GET['type']; ?>
");
});
</script>
</div>